package cn.openea.perpartner.meily.web.entity;

import cn.openea.perpartner.common.core.text.Convert;
import cn.openea.perpartner.meily.constant.enums.GoodsTypeEnums;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * (Goods)表实体类
 *
 * @author Weird077
 * @since 2023-01-11 21:04:18
 */
@Data
@TableName("meily_goods")
public class Goods implements Serializable {
    private final static long serialVersionUID = 1L;
    @TableId
    private Long goodsId;
    @ApiModelProperty(value = "商品编号")
    private String goodsNo;
    /**
     * {@link GoodsTypeEnums}
     * 默认签约商品
     */
    @ApiModelProperty(value = "商品类型")
    private String goodsType;
    @ApiModelProperty(value = "商品名称")
    private String goodsName;
    @ApiModelProperty(value = "商品主图")
    private String goodsImages;
    @ApiModelProperty(value = "商品分类")
    private String category;
    @ApiModelProperty(value = "商品标签")
    private String goodsTag;
    @ApiModelProperty(value = "客服ID")
    private String csId;
    @ApiModelProperty(value = "客服名称")
    private String csName;
    @ApiModelProperty(value = "商品详情")
    private String detail;
    @ApiModelProperty(value = "商品规格")
    private String specification;
    @ApiModelProperty(value = "爆品售价（元）")
    private String discountPrice;
    @ApiModelProperty(value = "爆品原价（元）")
    private String goodsPrice;
    @ApiModelProperty(value = "供货价（元）")
    private String supplyPrice;
    @ApiModelProperty(value = "商品库存")
    private String inventory;
    @ApiModelProperty(value = "物流方式")
    private String logistics;
    @ApiModelProperty(value = "偏远地区运费补充")
    private String extraFreight;
    @ApiModelProperty(value = "测评师帮卖报酬")
    private String evaluatorReward;
    @ApiModelProperty(value = "工作者帮卖报酬")
    private String workerReward;
    @ApiModelProperty(value = "商品卖点")
    private String peculiarity;
    @ApiModelProperty(value = "商品状态")
    private String status;
    @ApiModelProperty(value = "定制ID")
    private String sceneAssetsId;
    @ApiModelProperty(value = "场景名称")
    private String sceneAssetsName;
    @ApiModelProperty(value = "场景ID")
    private String sceneId;
    @ApiModelProperty(value = "帮卖客服id")
    private String helpCsId;
    @ApiModelProperty(value = "帮卖客服")
    private String helpCsName;
    private String createUser;
    @TableField(fill = FieldFill.INSERT)
    private String createTime;
    private String updateUser;
    private String updateTime;
    @ApiModelProperty(value = "置顶排序")
    private String goodsTop;
    @ApiModelProperty(value = "是否通过评测。0:否；1:是")
    private String passEvaluation;
    @ApiModelProperty(value = "开启分销功能。0:否；1:是")
    private String enableDistribution;
    @ApiModelProperty(value = "优惠券金额")
    private String couponAmount;
    @ApiModelProperty(value = "分销佣金")
    private String distributionReward;

    @ApiModelProperty(value = "已售数量")
    @TableField(exist = false)
    private String soldNum;

    @ApiModelProperty(value = "自定义销量")
    private String customSales;


    @ApiModelProperty(value = "所属品牌")
    private String brand;
    @ApiModelProperty(value = "品牌等级")
    private String brandGrade;
    @ApiModelProperty(value = "测评规则与需求")
    private String remarks;
    @ApiModelProperty(value = "货源地")
    private String originAddr;
    @ApiModelProperty(value = "帮卖周期")
    private String helpCycle;
    @ApiModelProperty(value = "上架时间")
    private String releaseTime;
    @ApiModelProperty(value = "下线时间段")
    private String offlineTime;
    @ApiModelProperty(value = "百人团购价")
    private String hundredPrice;
    @ApiModelProperty(value = "千人团购价")
    private String thousandPrice;
    @ApiModelProperty(value = "万人团购价")
    private String tenThousandPrice;

    @ApiModelProperty(value = "百人团")
    private String hundredGroup;
    @ApiModelProperty(value = "百人团销利润")
    private String hundredProfit;
    @ApiModelProperty(value = "百人团：消费者返现份额")
    private String hundredConsumerTranche;
    @ApiModelProperty(value = "百人团：消费者返现金额")
    private String hundredConsumerCashback;
    @ApiModelProperty(value = "百人团：线上服务商返利份额")
    private String hundredOnlineTranche;
    @ApiModelProperty(value = "百人团：线上服务商返利金额")
    private String hundredOnlineCashback;
    @ApiModelProperty(value = "百人团：区域服务商奖励份额")
    private String hundredProviderTranche;
    @ApiModelProperty(value = "百人团：区域服务商奖励金额")
    private String hundredProviderCashback;
    @ApiModelProperty(value = "千人团")
    private String thousandGroup;
    @ApiModelProperty(value = "千人团销利润")
    private String thousandProfit;
    @ApiModelProperty(value = "千人团：消费者返现份额")
    private String thousandConsumerTranche;
    @ApiModelProperty(value = "千人团：消费者返现金额")
    private String thousandConsumerCashback;
    @ApiModelProperty(value = "千人团：线上服务商返利份额")
    private String thousandOnlineTranche;
    @ApiModelProperty(value = "千人团：线上服务商返利金额")
    private String thousandOnlineCashback;
    @ApiModelProperty(value = "千人团：区域服务商奖励份额")
    private String thousandProviderTranche;
    @ApiModelProperty(value = "千人团：区域服务商奖励金额")
    private String thousandProviderCashback;


    @ApiModelProperty(value = "万人团")
    private String tenThousandGroup;
    @ApiModelProperty(value = "万人团销利润")
    private String tenThousandProfit;
    @ApiModelProperty(value = "万人团：消费者返现份额")
    private String tenThousandConsumerTranche;
    @ApiModelProperty(value = "万人团：消费者返现金额")
    private String tenThousandConsumerCashback;
    @ApiModelProperty(value = "万人团：线上服务商返利份额")
    private String tenThousandOnlineTranche;
    @ApiModelProperty(value = "万人团：线上服务商返利金额")
    private String tenThousandOnlineCashback;
    @ApiModelProperty(value = "万人团：区域服务商奖励份额")
    private String tenThousandProviderTranche;
    @ApiModelProperty(value = "万人团：区域服务商奖励金额")
    private String tenThousandProviderCashback;

    @ApiModelProperty(value = "分销利润")
    private String distributionProfit;
    @ApiModelProperty(value = "利润分配")
    private String percentageProfit;
    @ApiModelProperty(value = "线上服务商分销报酬")
    private String foremanReward;
    @ApiModelProperty(value = "消费者分享报酬")
    private String consumerShareReward;
    @ApiModelProperty(value = "玫丽平台利润")
    private String platformProfit;

    @ApiModelProperty(value = "商品属性")
    private String productAttribute;
    @ApiModelProperty(value = "属性颜色")
    private String attributeColor;
    @ApiModelProperty("0 显示默认备注内容 1 显示提醒内容")
    private Short remarkReminder = 0;
    @ApiModelProperty("提醒内容")
    private String reminderContent;
    @ApiModelProperty("发货链接")
    private String shippingLink;
    @ApiModelProperty("微信客服id")
    private String openKfid;
    @ApiModelProperty("用户限购数量")
    private int purchaseQuota;
    @ApiModelProperty("商品供应链")
    private String supplyChain;
    @ApiModelProperty("商品供应链表对应的Id")
    private Long supplyChainId;
    @ApiModelProperty("所属企业编码")
    private String enterpriseNo;
    @ApiModelProperty("所属企业名称")
    private String enterpriseName;

    public String getGoodsTop() {
        return Convert.toStr(Convert.toInt(goodsTop));
    }

    public void setGoodsTop(String goodsTop) {
        if (goodsTop == null){
            return;
        }
        if (goodsTop.length() == 1){
            // 单位数 前面补0
            goodsTop = "0" + goodsTop;
        }
        this.goodsTop = goodsTop;
    }
}

